import java.util.*;
import java.text.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Annotation;

class Employee {
    String name;
    Date dateOfBirth;
    double currentSalary;
    String designation;
    
    public Employee() {
        
    }
    
    public Employee(String n, Date b, double s, String d) {
        this.name = n;
        this.dateOfBirth = b;
        this.currentSalary = s;
        this.designation = d;
    }
    
    public Employee(String n, int y, int m, int d, double s, String des) {
        GregorianCalendar cl = new GregorianCalendar(y, m, d);
        this.name = n;
        this.dateOfBirth = cl.getTime();
        this.currentSalary = s;
        this.designation = des;
    }
    
    public double getCurrentSalary() {
        return currentSalary;
    }
    
    public Date getDateOfBirth() {
        return dateOfBirth;
    }
    
    public String getDesignation() {
        return designation;
    }
    
    public String getName() {
        return name;
    }
    
    public void setCurrentSalary(double currentSalary) {
        
    }
    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }
    
    public void setDesignation(String designation) {
        this.designation = designation;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    public void showEmployeeDetails() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
        System.out.format("%1$-20s %2$12s %3$10.2f %4$-20s\n",
                name,
                df.format(dateOfBirth),
                currentSalary,
                designation);
    }
    
    @Deprecated
    public void display() {
        showEmployeeDetails();
    }
    public void input() {
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\n");
        System.out.print("Input name : ");
        name = sc.next();
        int year,month,day;
        System.out.print("Input year : ");
        year = sc.nextInt();
        System.out.print("Input month : ");
        month = sc.nextInt();
        System.out.print("Input day : ");
        day = sc.nextInt();
        GregorianCalendar cl = new GregorianCalendar(year,month,day);
        this.dateOfBirth = cl.getTime();
        System.out.print("Input currentSalary : ");
        currentSalary = sc.nextDouble();
        System.out.print("Input designation : ");
        designation = sc.next();
    }
}

@Retention(RetentionPolicy.RUNTIME)
@interface StringValue {
    String str();
}

@Retention(RetentionPolicy.RUNTIME)
@interface Description {
    String description();
}

@Description (description = "The class Manager is derived from the class Employee.")
@StringValue (str = "Class leve l Annotation demo.")
class Manager extends Employee {
    double allowance;
    public Manager(double allowance) {
        this.allowance = allowance;
    }
    
    public Manager(String n, Date b, double s, String d, double a) {
        this.name = n;
        this.dateOfBirth = b;
        this.currentSalary = s;
        this.designation = d;
        this.allowance = a;
    }
    
    public Manager(String n, int y, int m, int d, double s, String des, double a) {
        GregorianCalendar cl = new GregorianCalendar(y, m, d);
        this.name = n;
        this.dateOfBirth = cl.getTime();
        this.currentSalary = s;
        this.designation = des;
        this.allowance = a;
    }
    
    @Override
    public void showEmployeeDetails() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
        System.out.format("%1$-20s %2$12s %3$10.2f %4$-20s\n",
                name,
                df.format(dateOfBirth),
                currentSalary + allowance,
                designation);
    }
}

@Retention(RetentionPolicy.RUNTIME)
@interface AdministratorAnnotation {
    String info();
}

@AdministratorAnnotation(info = "Annotation for the class Administrator.")
class Administrator {
    
    public Administrator() {
        
    }
    
    public static void main(String[] args) {
        Employee emp = new Employee("Luong Phuong Thao", 1989, 7, 20, 1000, "Clerk");
        emp.display();
        Manager man = new Manager("Nguyen Phi Hung", 1986, 5, 14, 900, "Sale manager", 600);
        man.showEmployeeDetails();
        Administrator adm = new Administrator();
        System.out.print("Annotations of the Manager class\n");
        Annotation annos[] = man.getClass().getAnnotations();
        for(Annotation x : annos) {
            System.out.print("\t" + x + "\n");
        }
        System.out.print("Annotations of the Administrator class\n");
        Annotation annos2[] = adm.getClass().getAnnotations();
        for(Annotation x : annos2) {
            System.out.print("\t" + x + "\n");
        }
    }
}
